package services.impl;

import beans.Contact;
import dao.ContactDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.ContactServices;

import java.util.List;

@Service
public class ContactServicesImpl implements ContactServices {

    @Autowired
    private ContactDao contactDao;

    @Override
    public List<Contact> selectSelective(String selectText,String inputText) {
        List<Contact> list = contactDao.selectSelective(selectText, inputText);
        return list;
    }

    @Override
    public List<Contact> selectList() {
        List<Contact> list = contactDao.selectList();
        return list;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        int i = contactDao.deleteByPrimaryKey(id);
        return i;
    }

    @Override
    public int insert(Contact record) {
        int i = contactDao.insert(record);
        return i;
    }

    @Override
    public int insertSelective(Contact record) {
        int i = contactDao.insertSelective(record);
        return i;
    }

    @Override
    public Contact selectByPrimaryKey(Integer id) {
        Contact contact = contactDao.selectByPrimaryKey(id);
        return contact;
    }

    @Override
    public int updateByPrimaryKeySelective(Contact record) {
        int i = contactDao.updateByPrimaryKeySelective(record);
        return i;
    }

    @Override
    public int updateByPrimaryKey(Contact record) {
        int i = contactDao.updateByPrimaryKey(record);
        return i;
    }

    @Override
    public int count() {
        return contactDao.count();
    }
}
